package com.indexingsystem.system.service;

import java.util.List;
import java.util.Map;
import java.util.Set;

import com.indexingsystem.boss.Vo.InstitutionsInfoVo;
import com.indexingsystem.boss.Vo.InstitutionsListVo;
import com.indexingsystem.boss.Vo.InstitutionsVo;
import com.indexingsystem.boss.Vo.QueryInstitutionsVo;
import com.indexingsystem.boss.Vo.StatusList;
import com.indexingsystem.boss.Vo.TreeQueryVo;
import com.indexingsystem.boss.common.PagedResult;
import com.indexingsystem.boss.entity.Institutions;

public interface InstitutionsService {
	public   void   test() ;
	int deleteByPrimaryKey(String institutionId) throws Exception;

	int deleteInstitutionsByIdBatch(List<String> institutionIdList) throws Exception;
	
	/**
	 * 获取已到期并且已禁用机构.
	 * @param institutionIdList
	 * @return
	 */
	List<InstitutionsInfoVo> getInstitutionsByValidDateIsDelte(List<String> institutionIdList);

	int insertSelective(Institutions record) throws Exception;

	PagedResult<QueryInstitutionsVo> selectInstitutionsCountList(InstitutionsVo institutionsCountVo, Integer pageNo,
			Integer pageSize);

	PagedResult<Institutions> selectInstitutionsList(Integer pageNo, Integer pageSize);
	
	
	/**
	 * 通过机构id导出离线升级包.
	 * @param institutionId
	 */
	String  exportInstitutionsListById(String institutionId);
	

	/**
	 * 通过机构id查询所属机构信息.
	 * 
	 * @param institutionId
	 * @return
	 */
	InstitutionsInfoVo getParentInstitutionsById(String institutionId);

	/**
	 * 查询子机构分页查询
	 * 
	 * @param institutionId
	 * @param pageNo
	 * @param pageSize
	 * @return
	 */
	PagedResult<Institutions> selectSublevelInstitutionsList(TreeQueryVo treeQueryVo);

	/**
	 * 通过机构id查询子机构列表信息.
	 * 
	 * @param institutionId
	 * @return
	 */
	List<Institutions> getSublevelInstitutionsList(String institutionId);

	/**
	 * 获取子机构总数.
	 * 
	 * @param institutionId
	 * @return
	 */
	Integer getSublevelInstitutionsListSize(TreeQueryVo treeQueryVo);

	Institutions selectByPrimaryKey(String institutionId);

	List<InstitutionsVo> selectBindUser(String institutionId);

	int updateByPrimaryKeySelective(Institutions record) throws Exception;

	/**
	 * 通过机构名称查询机构信息.
	 * 
	 * @param institutionName
	 * @return
	 */
	Institutions selectInstitutionsByName(String institutionName);

	/**
	 * 修改用户及机构信息.
	 * 
	 * @param userInstitutionVo
	 * @return
	 */
	int updateInstitutionsInfo(Institutions institutions) throws Exception;

	/**
	 * 通过机构id查询机构信息.
	 * 
	 * @param institutionId
	 * @return
	 */
	Map<String, String> selectByInstitutionId(String institutionId) throws Exception;

	/**
	 * 通过用户id查询机构信息.
	 * 
	 * @param userId
	 * @return
	 */
	List<Institutions> getInstitutionsByUserId(String userId);

	/**
	 * 获取机构总数.
	 * 
	 * @return
	 */
	Integer getInstitutionsCount();

	/**
	 * 获取机构上\下级级联关系列表.
	 * 
	 * @return
	 */
	List<InstitutionsListVo> getInstitutionsList();

	/**
	 * 批量启用，禁用机构.
	 * 
	 * @param statusList
	 * @return
	 */
	int batchUpdateInstitutionsWithMap(List<StatusList> statusList);
	
	/**
	 * 判断机构Id是否存在
	 * @param institutionId
	 * @return
	 */
	String getInstitutionsId(String institutionId);
	
	/**
	 * 通过用户id查询所属机构
	 * @param userId
	 * @return
	 */
	Institutions getInstitutionsById(String userId);

    /**
     * 通过机构id查询子级、所有子级、遍历至最上级根目录Tree机构树形.
     * 
     * @param institutionId
     * @return
     */
    Set<String> getPublishInstitutionsTreeList(String institutionId);
    
    
    /**
     * 通过父级机构id获取子级最大的到期日期.
     * @param id
     * @return
     */
    String getSublevelInstitutionsMaxVaildDate(String id);
    /**
	 * 获取机构列表.
	 * 
	 * @return
	 */
	List<Institutions> selectInstitutionsList();
	
	  List<String>  getAllInstitutions(String  institutionId,List<String>  InstitutionsStringList) ;
}